﻿using System.Web.Mvc;
using QDT.Common;
using QDT.Services.ArticleMoudule;
using QDT.Services.Projects;

namespace QDT.Web.Controllers
{
    public partial class WidgetController : BaseController
    {
        private readonly IArticleService ArticleService;

        public WidgetController(IArticleService articleService) {
            
            ArticleService = articleService;
        }

        protected PartialViewResult ChildResult(object model)
        {
            if(RouteData.Values.ContainsKey(WidgetExtensions.ViewKey))
            {
                var viewPath = RouteData.Values[WidgetExtensions.ViewKey] as string;
                return PartialView(viewPath, model);
            }
            return PartialView(model);
        }

        protected PartialViewResult ChildResult(string viewName, object model)
        {
            return PartialView(viewName, model);
        }

    }
}
